import React from 'react';
import { Tooltip } from 'antd';
// import { history } from 'umi'
import qs from 'qs';
import AuthComponent from '@/utils/auth/AuthComponent';

import BizIcon from '@/components/BizIcon';

export default function NoticeLink({ title = '浏览offer信息', type = 'chakanfabuxinxi', params = {} }) {
    return (
        <AuthComponent code="office:recruitment:course:hire:detail:offer">
            <Tooltip title={title}>
                <BizIcon
                    type={type}
                    style={{ cursor: 'pointer' }}
                    onClick={() => {
                        window.open(`/user/hireConfirm?${qs.stringify(params)}`);
                        // history.push({
                        //     pathname: '/user/hireConfirm',
                        //     query: params
                        // });
                    }}
                />
            </Tooltip>
        </AuthComponent>
    );
}
